import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {WorkStatus} from '../../../services/news/momain/work-status';
import {WorkStatusService} from '../../../services/news/WorkStatus/work-status.service';

@Component({
  selector: 'app-work-report',
  templateUrl: './work-report.component.html',
  styleUrls: ['./work-report.component.less']
})
export class WorkReportComponent implements OnInit {

  workStatus: Observable<WorkStatus[]>;

  @Output('order')
  order: EventEmitter<string> = new EventEmitter();

  constructor(private workStatusService: WorkStatusService) {

  }

  ngOnInit() {
    this.workStatus = this.workStatusService.getList();
  }

  toEdit(workStatu: WorkStatus, order: number): void {
    let value: string = workStatu.id + '-' + order;
    this.order.emit(value);
  }

}
